<div class="panel panel-default panel-intro">

    <div class="panel-heading">
        {:__('Info')}
    </div>
    {if condition="$detail neq null "}

    <div class="panel-body newrow prindBody">
        <div class="row">
            <div class="col-md-4 col-xs-12 form-group code">
                <label class="control-label col-xs-12 col-sm-3">{:__('Code')}:</label>
                <div class="col-xs-12 col-sm-6">
                    {$detail[0]['code']}
                </div>
            </div>
            <div class="col-md-4 col-xs-12 form-group print-row">
                <label class="control-label col-xs-12 col-sm-3">{:__('Supplier')}:</label>
                <div class="col-xs-12 col-sm-6">
                    {$detail[0]['supplier']}
                </div>
            </div>
            <div class="col-md-4 col-xs-12 form-group print-row">
                <label class="control-label col-xs-12 col-sm-3">{:__('Contact')}:</label>
                <div class="col-xs-12 col-sm-6">
                    {$detail[0]['contact']}
                </div>
            </div>
            <div class="col-md-4 col-xs-12 form-group print-row">
                <label class="control-label col-xs-12 col-sm-3">{:__('Phone')}:</label>
                <div class="col-xs-12 col-sm-6">
                    {$detail[0]['phone']}
                </div>
            </div>
            <div class="col-md-4 col-xs-12 form-group print-row">
                <label class="control-label col-xs-12 col-sm-3">{:__('Delivery')}:</label>
                <div class="col-xs-12 col-sm-6">
                    {$detail[0]['delivery_time']|date="Y-m-d",###}
                </div>
            </div>
            <div class="col-md-4 col-xs-12 form-group print-row">
                <label class="control-label col-xs-12 col-sm-3">{:__('Type')}</label>
                <div class="col-xs-12 col-sm-6">
                    {:__("Type ".$detail[0]['type'])}
                </div>
            </div>
            <div class="col-md-4 col-xs-12 form-group  print-row">
                <label class="control-label col-xs-12 col-sm-3">{:__('Billing')}:</label>
                <div class="col-xs-12 col-sm-6">
                    {$detail[0]['billing_time']|date="Y-m-d",###}
                </div>
            </div>
            <div class="col-md-4 col-xs-12 form-group print-row">
                <label class="control-label col-xs-12 col-sm-3">{:__('Warehouse')}:</label>
                <div class="col-xs-12 col-sm-6">
                    {$detail[0]['warehouse_id']}/{$detail[0]['warehouse_partition_id']}
                </div>
            </div>
            <div class="col-md-12 col-xs-12 form-group print-row">
                <label class="control-label col-xs-12 col-sm-1">{:__('Adress')}:</label>
                <div class="col-xs-12 col-sm-10">
                    {$detail[0]['city']}{$detail[0]['address']}

                </div>
            </div>
            <div class="col-md-4 col-xs-12 form-group print-remark">
                <label class="control-label col-xs-12 col-sm-3">{:__('Remark')}:</label>
                <div class="col-xs-12 col-sm-6">
                    {$detail[0]['remark']}
                </div>
            </div>

            {if condition="$detail[0]['status'] eq 1"}
            <div class="col-md-12 col-xs-12 form-group print-row">
                <label class="control-label col-xs-12 col-sm-1" style="color: red">{:__('Reason for failure')}:</label>
                <div class="col-xs-12 col-sm-11">
                    {$detail[0]['reason']}
                </div>
            </div>
            {/if}
        </div>
        <div class="table-responsive">
            <table class="table table-striped">
                <tr>
                    <th>{:__('Serial number')}</th>
                    <th>{:__('Sku')}</th>
                    <th>{:__('Commodity')}</th>     
                    <th>{:__('Specification')}</th>
                    <th>{:__('Attributes')}</th>
                    <th>{:__('Unit')}</th>
                    <th>{:__('Quantity')}</th>
                    <th>{:__('unit price')}</th>
                    <th>{:__('Subtotal')}</th>
                    <th>{:__('Remarks')}</th>
                </tr>
                {volist name="product" id="vo" key="k"}
                <tr>
                    <td>{$k}</td>
                    <td>{$vo.products['sku']}</td>
                    <td>{$vo.products['name']}</td>
                    <td>{$vo.products['specification']}</td>
                    <td>

                        {volist name="$vo.products['prop']" id="val"}
                        {$val.title}:{:isset($val['value'])?$val['value']:""}
                        {/volist}
                    </td>
                    <td>{$vo.products.unit}</td>
                    <td>{$vo.nums}</td>
                    <td>{$vo.price}</td>
                    <td>{$vo.subtotal}</td>
                    <td>{$vo.remarks}</td>
                </tr>
                {/volist}
                <td>{:__("Total")}</td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td>{$detail[0]['totalNums']}</td>
                <td></td>
                <td>{$detail[0]['money']}</td>
                <td></td>

            </table>
        </div>
        <div style="padding-top: 20px;">
            <div class="row print-total">
                <div class="col-md-4 col-xs-12 form-group .print-total-row">
                    <div  class="control-label col-xs-12 col-sm-12">
                        <label class="control-label col-xs-12 col-sm-3">{:__('Rate')}:</label>
                        <div class="col-xs-12 col-sm-3">
                            {$detail[0]['rate']}
                        </div>
                    </div>
                    <div  class="control-label col-xs-12 col-sm-12 .print-total-row">
                        <label class="control-label col-xs-12 col-sm-3">{:__('BefMoney')}:</label>
                        <div class="col-xs-12 col-sm-3">
                            {$detail[0]['money']}
                        </div>

                    </div>
                    <div  class="control-label col-xs-12 col-sm-12 .print-total-row">
                        <label class="control-label col-xs-12 col-sm-3">{:__('TotalMoney')}:</label>
                        <div class="col-xs-12 col-sm-9">
                            {$detail[0]['totalMoney']}
                        </div>
                    </div>
                </div>
            </div>
            <div class="row no-print">
                <div  class="col-md-12 col-xs-12 form-group" style="text-align: right;">	
                    {if condition="$detail[0]['status'] eq 0"}
                    <a class="btn btn-default {:$auth->check('ykjp/purchase/order/edit')?'':'hide'}" href="{:url('/ykjp/purchase/order/edit',array('ids'=>$detail[0]['id']))}" role="button">{:__('Modify')}</a>
                    <a class="btn btn-default {:$auth->check('ykjp/purchase/approval/updateSatus')?'':'hide'}"   onclick="appr('yes', {$detail[0]['id']})" role="button">{:__('Approved yes')}</a>
                    <a class="btn btn-default  {:$auth->check('ykjp/purchase/approval/updateSatus')?'':'hide'}"  onclick="appWhy({$detail[0]['id']})" role="button">{:__('Approved no')}</a>

                    {/if}
                    {if condition="$detail[0]['status'] eq 1 or $detail[0]['status'] eq 2"}
                    {if condition="$isCount eq 0"}
                    <a class="btn btn-default {:$auth->check('ykjp/purchase/order/Anti')?'':'hide'}" onclick="Anti({$detail[0]['id']})"  role="button">{:__('Anti')}</a>
                    {/if}
                    {/if}

                    <!-- <a class="btn btn-default" href="#" role="button">打印</a> -->
                </div>
            </div>
        </div>
    </div>

    {/if}
